home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 351-375 / 359 / dice / dice.lzh / lib / fd / makefd.c < prev    next >
C/C++ Source or Header  |  1990-04-01  |  553b  |  33 lines

  1.  
  2. /*
  3.  *  MAKEFD.C
  4.  *
  5.  *  (c)Copyright 1990, Matthew Dillon, All Rights Reserved
  6.  *
  7.  *  Used by routines that want to get into our low level io system.  If exec
  8.  *  is NULL then handle is an AmigaDOS file handle.  If exec is not NULL then
  9.  *  it is a function capable of executing ioctls.
  10.  */
  11.  
  12. #include <stdio.h>
  13. #include <fcntl.h>
  14.  
  15. int
  16. MakeFd(handle, flags, exec)
  17. long handle;
  18. long flags;
  19. long (*exec)();
  20. {
  21.     int fd;
  22.     _IOFDS *d = _MakeFD(&fd);
  23.  
  24.     d->fd_Fh = handle;
  25.     d->fd_Flags = flags | O_ISOPEN;
  26.     d->fd_Exec = exec;
  27.  
  28.     return(fd);
  29. }
  30.  
  31.  
  32.  
  33.